package com.lingchen.boot.gof.proxy.cglib;

import org.springframework.cglib.proxy.MethodInterceptor;
import org.springframework.cglib.proxy.MethodProxy;

import java.lang.reflect.Method;

/**
 * Created by lc on 2020/6/28
 */
public class SFang implements MethodInterceptor {

    private Object  instance;

    public SFang(Object instance) {
        this.instance = instance;
    }

    @Override
    public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable {
        objects[0] = "替租户交租"+objects[0];
        return method.invoke(instance,objects);
    }
}
